package com.zyc.decorateMode.example;

/**
 * @author zyc
 * @create 2022--06--15 16:51
 */
public class Main {
    public static void main(String[] args) {
        ConcreteComponent c = new ConcreteComponent();
        ConcreteDecoratorA decoratorA = new ConcreteDecoratorA();
        ConcreteDecoratorB decoratorB = new ConcreteDecoratorB();
        // 首先用 A 装饰器装饰具体组件，然后用 B 装饰器装饰 A 。
        decoratorA.setComponent(c);
        decoratorB.setComponent(decoratorA);
        decoratorB.operation();
    }
}
